package com.kingland.hanshilong.controller;


import com.kingland.hanshilong.model.UserModel;
import com.kingland.hanshilong.service.UserService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {

    private UserService userService;
    public UserController(UserService userService){
        this.userService = userService;
    }
    @PostMapping("/user")
    public UserModel addUser(@RequestBody UserModel userModel){
        System.out.println(userModel.getId());
        return this.userService.addUser(userModel);
    }
}
